import { WxpayV2Fix } from "./wxpay-v2-fix";

const { WX_SP_MCHID, WX_SP_MP_ID, WX_SP_KEY_V2 } = process.env;
// const rootDir = process.cwd() + "/pem/" + WX_SP_MCHID;

const wxpay = new WxpayV2Fix({
  appid: WX_SP_MP_ID,
  mch_id: WX_SP_MCHID,
  keyV2: WX_SP_KEY_V2,
});

export async function partnerAddReceiver(receiver, opts = {}) {
  return wxpay.profitsharingaddreceiver({
    receiver,
    ...opts,
  });
}
export async function parterProfitSharing(params) {
  return wxpay.profitsharing(params);
}
